const packageConfig = require('../../package.json');

/**
 * 获取版本
 * @returns {string|string}
 */
const getVersion = () => {
  //const version = readFile(path.join(__dirname, '../../version')).trim();  // return version;
  return packageConfig.version || '1.0.0';
}

/**
 * 获取测试版本
 * @returns {string|string}
 */
const getTestVersion = () => {
    return packageConfig.version || '1.0.0';
}

/**
 * 获取 当前环境
 * @returns {string|string}
 */
const getEnvironment = () => {
  return process.env.NODE_ENV || 'dev';
}


module.exports = {
    getVersion,
    getTestVersion,
    getEnvironment,
}